/**
 * 
 */
package com.googlecode.dynargs.model.type;

import java.util.ArrayList;
import java.util.List;

/**
 * @author Federico De Faveri defaveri@gmail.com
 *
 */
public class ObjectType extends AbstractType {
	
	protected List<ObjectField> fields;
	
	public ObjectType(String id) {
		super(id, MetaType.OBJECT);
		this.fields = new ArrayList<ObjectField>();
	}
	
	public void addField(ObjectField field)
	{
		fields.add(field);
	}
	
	public List<ObjectField> getFields()
	{
		return fields;
	}

	/**
	 * {@inheritDoc}
	 */
	@Override
	public String toString() {
		StringBuilder builder = new StringBuilder();
		builder.append("ObjectType [id=");
		builder.append(id);
		builder.append(", fields=");
		builder.append(fields);
		builder.append("]");
		return builder.toString();
	}	
}